From 450c219ae4c8dd5ac8a702d80053c842668d9cc8 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Wed, 17 Sep 2008 22:33:56 +0000 Subject: [PATCH] gpx: Write track extensions before tag 'trkseg' (published in german c't 2008/19) and write track/route extensions only if gpx version 1.1 was specified. --- gpx.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/gpx.c b/gpx.c index 6363d9e11..cef110ffb 100644 --- a/gpx.c +++ b/gpx.c @@ -1676,12 +1676,15 @@ gpx_track_hdr(const route_head *rte) if (rte->rte_num) { gbfprintf(ofd, "%d\n", rte->rte_num); } - gbfprintf(ofd, "\n"); - - fs_gpx = (fs_xml *)fs_chain_find( rte->fs, FS_GPX ); - if ( fs_gpx ) { - fprint_xml_chain( fs_gpx->tag, NULL ); + + if (gpx_wversion_num > 10) { + fs_gpx = (fs_xml *)fs_chain_find( rte->fs, FS_GPX ); + if ( fs_gpx ) { + fprint_xml_chain( fs_gpx->tag, NULL ); + } } + + gbfprintf(ofd, "\n"); } static void @@ -1749,9 +1752,11 @@ gpx_route_hdr(const route_head *rte) gbfprintf(ofd, " %d\n", rte->rte_num); } - fs_gpx = (fs_xml *)fs_chain_find( rte->fs, FS_GPX ); - if ( fs_gpx ) { - fprint_xml_chain( fs_gpx->tag, NULL ); + if (gpx_wversion_num > 10) { + fs_gpx = (fs_xml *)fs_chain_find( rte->fs, FS_GPX ); + if ( fs_gpx ) { + fprint_xml_chain( fs_gpx->tag, NULL ); + } } } -- 2.30.2